import multiprocessing
import os

from zhanshop.env import Env
from zhanshop.app import App
from zhanshop.helper.str import Str

App.make(Env).init(os.path.dirname(os.path.dirname(__file__)))
host = App.make(Env).get("server.host", "0.0.0.0")
if(Str.ipType(host) == "ipv6"): host = "["+host+"]"

bind = host+":"+App.make(Env).get("server.port", "9021")
if(App.make(Env).get("server.env") == "test"): 
    workers = 1
else:
    workers = multiprocessing.cpu_count()
    if(workers >= 8): workers = 8
    workers = workers * 2 + 1
threads = 2
worker_connections = 100000
max_requests = 0
worker_class = "sync"
daemon = False
timeout = 9999999999
max_requests=2048
loglevel = 'error'